package com.tensquare.search.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

@Document(indexName = "articleindex",type = "article")
public class Article implements Serializable {


    @Id
    private String id;//ID

    //是否索引 就是看该域是否能被收索
    //是否分词 就是表示收索的时候是整体匹配 还是单词匹配
    //是否存储 就是是否在页面上显示
    //收索的时候 按所有索引收索 只要匹配上 就显示
    @Field(index = true,type = FieldType.text,analyzer = "ik_max_word1",searchAnalyzer ="ik_max_word1")
    private String title;//标题

    @Field(index = true,type = FieldType.text,analyzer = "ik_max_word1",searchAnalyzer ="ik_max_word1")
    private String content;//文章正文

    private String state;//审核状态  一般数据库删不是真的删 而是逻辑上删除 通过审核状态判断

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }
}
